package com.aplink.generic.constant.type;

public enum ProgressDialogStatusType {
	CHANGE_PASSWORD(0xF300010, "ChangePassword"),
	DELETE(0xF300005, "Delete"),
	DOWNLOAD(0xF300003, "Download"),
	DOWNLOAD_ALL(0xF300011, "DownloadAll"),
	FORGOT_PASSWORD(0xF300009, "ForgotPassword"),
	INIT_DATA(0xF300002, "InitData"),
	INSERT(0xF300006, "Insert"),
	LOGIN(0xF300001, "Login"),
	SAVE(0xF300008, "Save"),
	UPDATE(0xF300007, "Update"),
	UPLOAD(0xF300004, "Upload");
	public static ProgressDialogStatusType get(final int key) {
		for (final ProgressDialogStatusType dialogRule : ProgressDialogStatusType
				.values()) {
			if (dialogRule.getCode() == key) {
				return dialogRule;
			}
		}
		return null;
	}

	public static ProgressDialogStatusType get(final String key) {
		for (final ProgressDialogStatusType dialogRule : ProgressDialogStatusType
				.values()) {
			if (dialogRule.getValue().equals(key)) {
				return dialogRule;
			}
		}
		return null;
	}

	private int mCode;

	private String mValue;

	private ProgressDialogStatusType(final int code, final String value) {
		this.mValue = value;
		setCode(code);
	}

	public int getCode() {
		return this.mCode;
	}

	public String getValue() {
		return this.mValue;
	}

	public void setCode(final int code) {
		this.mCode = code;
	}

	public void setValue(final String value) {
		this.mValue = value;
	}
}
